/**
 * @file
 * @description 购物车
 * **/

import request from './request'
/**
 * @method
 * @description 获取购物车数据
 */
export const getCart = () => request.get('member/cart')
/**
 * @method
 * @description 修改checked状态
 * @param id 商品id
 * @param flag 商品状态
 */
export const updata = (id, flag) => request.put(`member/cart/${id}`, { selected: flag })
/**
 * @method
 * @description 修改checked全选状态
 *  @param ids 商品id
 * @param selected 商品状态
 */
export const updataAll = (ids, selected) => request.put('member/cart/selected', { ids, selected })
/**
 * @method
 * @description 修改单品数量
 *  @param id 商品id
 * @param count 商品数量
 */
export const undataNum = (id, count) => request.put(`member/cart/${id}`, { count })
/**
 * @method
 * @description 删除商品
 *  @param id 商品id 
 */
export const deleteShop = (id) => request.delete('member/cart', { ids: id })
